<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>title</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css"/>
		<link rel="stylesheet" type="text/css" href="../css/aui.css"/>
		<link rel="stylesheet" type="text/css" href="../icon/aosen/css/font-awesome.min.css" />
    <style>
    	body,html{
				background:white;
				-webkit-user-select:all 
    	}
			.introduce{
				width: 100%;
				height: 2.4rem;
				background: white;
				line-height: 2.4rem;
				text-align: center;
				font-size: 5vw;
				border-bottom: 1px solid #eee;
			}
			.content{
				background: white;
				padding: 0.5rem;
			}
			.buttons{
				background: white;
				width: 100%;
				display:flex;
				display:-webkit-flex;
				-webkit-justify-content: center;
    		justify-content: center;
				position: absolute;;
				bottom: 0;
			}
			.button{
				width: 5rem;
				height:2rem;
				background: #e14104;
				border-radius:1rem;
				line-height: 2rem;
				text-align: center;
				color: white;
				margin: 1.5rem
			}
			
    </style>
</head>
<body>
	<div class="introduce">
		<i class="fa fa-book" style="color:#e14104"></i>
		交易说明
	</div>
	<div class="content">
		1、双方协商达成一致后，由卖家进入“我是卖家”界面，填写交易相关信息后点击“提交”，系统会自动生成交易码，卖家需妥善保管此交易码；
		<br>
		2、卖家将生成的交易码发给买家；
		<br>
		3、买家进入“我是买家”界面，填写交易码，进入支付页面进行支付。
		<br>
		4、买家支付后会直接进入与卖家的聊天界面，可以提醒卖家发货，卖家在订单页面点击发货。
		<br>
		5、卖家发货以后，买家进入订单页面确认收货，整个交易完成。
		<br>
		注：1、平台会收取一定的手续费，双方协商达成一致后确定谁支付手续费。
		<br>
		2、只有完成整个交易才可以积累经验值。
	</div>
	<div class="buttons">
		<div class="button" onclick="goToBuyerPage()">我是买家</div>
		<div class="button" onclick="goToSellerPage()">我是卖家</div>
	</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/request.js"></script>
<script type="text/javascript" src="../script/aui-dialog.js"></script>
<script type="text/javascript" src="../script/jquery-3.3.1.js"></script>
<script type="text/javascript">
	apiready = function(){

	};
	function goToSellerPage(){
			api.openWin({
					name: 'SellerPage',
					url: './win.html',
					pageParam: {
							page:'SellerPage',
							title: '卖家'
					}
			});
	}
	function goToBuyerPage(){
		var dialog = new auiDialog({})
		dialog.prompt({
        title:"交易码",
        text:'请输入交易码',
        buttons:['取消','确定']
    },function(ret){
    	
        if(ret.buttonIndex == 2){
            var data = {};
						data['values'] = {};
						data['values']['orderNum'] = ret.text;
						data['values']['buyerId'] = $api.getStorage('userId');
						requestData('Order/getYuehaoOrder',data,'NO','NO','NO',_callbackRelt);
        }
    })
	}
	function _callbackRelt(ret){
		if(ret.status == 200){
			api.openWin({
				name: 'buyerPage',
				url: './win.html',
				pageParam: {
						page:'buyerPage',
						title: '买家',
						data:ret
				}
			});
		}else{
			api.alert({
			    title: '温馨提示',
			    msg: ret.msg,
			});
		}
	}
	
</script>
</html>
